package com.ruoyi.web.controller.robot;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.OtherRoundConfig;
import com.ruoyi.system.service.IOtherRobotInfoService;
import com.ruoyi.system.service.IOtherRoundConfigService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * round 列表
 */
@RestController
@RequestMapping("/robot/roundconfig")
public class RobotRoomRoundConfigController extends BaseController {
    @Resource
    private IOtherRoundConfigService otherRoundConfigService;



    /**
     * 列出round列表
     *
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list() {
        List<OtherRoundConfig> depts = otherRoundConfigService.selectRoundConfigList();
        return success(depts);
    }

    /**
     * 通过roomid 查询round
     *
     * @param roomId
     * @return
     */
    @GetMapping("/roomId")
    public AjaxResult roomId(String roomId) {
        List<OtherRoundConfig> otherRoundConfigs = otherRoundConfigService.selectRoundConfigByRoomId(roomId);
        return success(otherRoundConfigs.get(0));
    }


}
